<?php

    header('Content-Type: text/html; charset=UTF-8');
    include_once '../../config.php';

    mysql_query("SET NAMES 'utf8'");
    mysql_query("SET CHARACTER SET 'utf8'");

    //Variablen
    $client_id  = $_POST['client_nr'];
    $address_id = $_POST['address_id'];
    $name       = $_POST['client_name'];
    $street     = $_POST['client_street'];
    $zip        = $_POST['client_zip'];
    $city       = $_POST['client_city'];

    if ($name == '' || $street == '' || $zip == '' || $city == '') {
        header('Location: ../mainlist.php?list=cl&fail=cleer');
    } else {
        $sql = "UPDATE client SET name = '" . $name . "' WHERE client_id = " . $client_id;
        mysql_query($sql);
        $sql = "UPDATE address SET street = '" . $street . "', zip = '" . $zip . "', city = '" . $city . "' WHERE address_id = " . $address_id;
        mysql_query($sql);

        header('Location: ../mainlist.php?list=cl');
    }

?>
